package com.china08.yxyapi.service.yxyresource;

import org.elasticsearch.index.query.BoolQueryBuilder;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;

import com.china08.yxyapi.entity.es.ElasticYxyResResource;

public interface YxyResourceBaseService {

    /** 查询 标题 上传人 上传人学校关键字 */
    void keywordTUS(String keyword, Integer type, BoolQueryBuilder builder);

    void keywordTU(String keyword, Integer type, BoolQueryBuilder builder);

    void keywordT(String keyword, Integer type, BoolQueryBuilder builder);

    /** 有关键字的查询 keywordType = 3 是查询多个字段的 title uploadName uploaderSchooNick */
    Page<ElasticYxyResResource> getPageKeyword(BoolQueryBuilder maxBoolQueryBuilder, String keyword,
            Integer keywordType, Pageable pageable);

    /** 资源查询分页Page */
    Page<ElasticYxyResResource> getPage(BoolQueryBuilder boolQueryBuilder, Pageable pageable);

    /** 查询资源数量 */
    long countResource(BoolQueryBuilder queryBuilder);

}
